<?php

namespace app\common;

enum ApiStatus: int
{
    case API_SUCCESS = 200;
    case API_ERROR = 400;
    case API_NOT_FOUND = 404;
    case API_NEED_LOGIN = 412;
    case API_NEED_VIP = 413;

    public function getStatus(): string
    {
        return match ($this) {
            self::API_SUCCESS    => '成功',
            self::API_ERROR      => '失败',
            self::API_NOT_FOUND  => 'Not Found',
            self::API_NEED_LOGIN => '请先登录',
            self::API_NEED_VIP   => '升级VIP',
        };
    }
}